package com.sfy.login.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sfy.login.entity.User;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Description
 * @Author 谷晓天
 * @Date 2021/7/4 2:55 下午
 */
public interface UserDao extends BaseMapper<User> {
    //根据手机号或163邮箱查询用户是否存在
    @Select("select * from t_user where phone = #{accent} or email = #{accent}")
    User selectByAccent(String accent);
    //用户注册
    int insertUser(User user);
    //冻结账号
    @Update("update t_user set flag = #{flag} where id = #{id}")
    int updateById(User user);

    User selectByUser(User user);
}
